package com.mouse.hxsj.entity.enums;

import com.mouse.damo.micro.Com;
import com.mouse.hxsj.service.FlyService;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 地图
 */
@Getter
@AllArgsConstructor
public enum MapPlace {
    yongle(37, 0, "", "永乐城"),
    //
    tianxi(53, 53, "", "天夕镇"),
    yunyan(53, 69, "", "云雁巢"),
    wanshou(53, 85, "", "万兽岗"),
    qunfang(53, 101, "", "群芳谷"),
    jiangnan(53, 117, "", "江南竹林"),
    mochou(53, 133, "", "莫愁湖"),
    taihua(53, 149, "", "太华山"),
    //
    junzi(69, 53, "", "君子国"),
    xiaoren(69, 69, "", "小人国"),
    juren(69, 85, "", "巨人国"),
    maomin(69, 101, "", "毛民国"),
    zhangfu(69, 117, "", "丈夫国"),
    qigong(69, 133, "", "奇肱国"),
    yiren(69, 149, "", "翼人国"),
    chenmeng(69, 165, "", "沉梦国"),
    yuetu(69, 181, "", "月兔国"),
    xuanyuan(69, 197, "", "轩辕国"),
    //
    mingshan(85, 53, "", ""),
    huanling(85, 69, "", ""),
    duanhun(85, 85, "", ""),
    diyan(85, 101, "", ""),
    huangquan(85, 117, "", ""),
    wangsi(85, 133, "", ""),
    fengdu(85, 149, "", ""),;
    /**
     * 第一个y坐标-飞来飞去
     */
    private int y1;
    /**
     * 第二个y坐标-飞来飞去
     */
    private int y2;
    /**
     * 惊动的地址图片
     */
    private String picPath;
    private String Map;

    public static List<MapPlace> zhiLu() {
        List<MapPlace> list = new ArrayList<>();
        list.addAll(Arrays.asList(junzi, xiaoren, juren, zhangfu, qigong, yiren, chenmeng, yuetu, xuanyuan));
        list.addAll(Arrays.asList(mingshan, huanling, huangquan, wangsi));
        return list;
    }

    public static MapPlace getByMap(String mapStr) {
        for (MapPlace mapPlace : values()) {
            if (mapPlace.getMap().equals(mapStr)) {
                return mapPlace;
            }
        }
        return null;
    }

    public static void fly(Com com, MapPlace mapPlace) {
        new FlyService().fly(com, mapPlace);
    }
}
